package hangzhou;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateSessionFactory {

	private static Configuration config;
	private static SessionFactory sf;
	
	public static Session getSession() {
		//���������ļ�
		config=new Configuration().configure();
		//����SessionFactory
		sf=config.buildSessionFactory();
		//��ȡsession
		return sf.openSession();
	}
}
